package org.itzheng.myrxframe.http.retrofit.utils;

import okhttp3.OkHttpClient;

/**
 * Title:用于获取Retrofit网络请求api服务器<br>
 * Description: <br>
 *
 * @email ItZheng@ZoHo.com
 * Created by itzheng on 2019-4-9.
 */
public class ApiServiceUtils {
    public static <T> T create(final Class<T> service) {
        return create(false, service);
    }

    public static <T> T create(boolean isDebug, final Class<T> service) {
        return RetrofitClient.getRetrofit(isDebug).create(service);
    }

    /**
     * 自定义 OkHttpClient
     *
     * @param okHttpClient
     * @param service
     * @param <T>
     * @return
     */
    public static <T> T create(OkHttpClient okHttpClient, final Class<T> service) {
        return RetrofitClient.getRetrofit(okHttpClient).create(service);
    }
}
